package mul.Logic;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;

public class HighScore {
	private int score = 0;
	private int lastScore = 0;
	private boolean lastScoreContainedGold = false;
	private float xpos;
	private float ypos;
	private Paint paint;
	
	public HighScore(float xpos, float ypos){
		this.score = 0;
		this.xpos = xpos;
		this.ypos = ypos;
		this.paint = new Paint();
		this.paint.setColor(Color.WHITE);
		this.paint.setTextAlign(Align.CENTER);
		this.paint.setTextSize(35);
	}
	public void addScore(int addScore, boolean containedGold){
		this.score += addScore;
		lastScore = addScore;
		if(containedGold)
			lastScoreContainedGold = true;
		else
			lastScoreContainedGold = false;
	}
	
	public void addScoreWithMultiplier(int score, int multiplier, boolean containedGold) {
		this.score += (score * multiplier);
		lastScore = (score * multiplier);
		if(containedGold)
			lastScoreContainedGold = true;
		else
			lastScoreContainedGold = false;
	}
	
	public int getLastScore() {
		return lastScore;
	}
	
	public boolean getLastScoreContainedGold() {
		return lastScoreContainedGold;
	}
	
	public void draw(Canvas canvas){
		canvas.drawText(this.getScore(), xpos, ypos, paint);
	}
	public String getScore(){
		String scoreString = ""+this.score;
		return scoreString;
	}
	public float getXpos(){
		return xpos;
	}
	public float getYpos(){
		return ypos;
	}
	public Paint getPaint() {
		return paint;
	}
	
}
